﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin_ReportDesign.aspx.cs" Inherits="Xiaov.SmartWeb.Application.PluginSrc.StatisticalSystem.ReportDesign.Admin_ReportDesign" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
     <link rel="stylesheet" type="text/css" href="/Resources/easyui-1.32/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="/Resources/easyui-1.32/themes/icon.css"/>
    <link rel="stylesheet" type="text/css" href="/Resources/xiaovcn/css/main.css"/>
    <script type="text/javascript" src="/Resources/easyui-1.32/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="/Resources/easyui-1.32/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/Resources/xiaovcn/scripts/common.js"></script>
    <script type="text/javascript" src="/Resources/xiaovcn/scripts/usercheck.js"></script>
    <script>
        function bindnode() {
            var xml = $('#ddl_xml').combo('getValue');
            $('#tt').datagrid({
                title: '' + xml + '',
                url: 'Json/XmlJson.aspx?xml=' + xml,
                iconCls: 'icon-edit',
                height: userScreenHeight-20, singleSelect: true, striped: true,
                width: '170',
                columns: [[
                             { field: 'NodeName', title: '节点名称', width: 100, sortable: true, formatter: function (val, rec) { return unescape(val) } }

                ]],
                onClickRow: function (row) {
                    editrow(row.NodeName);
                }
            });
        }

        function add(url, title) {
            if ($('#main').tabs('exists', title)) {
                if (confirm('已经打开了页面,是否关闭并重新加载该标签？\n警告：点击[确定]会关闭原有的标签页面并重新加载！！！如果你还没有保存过数据,请选【取消】！,')) {
                    //$('#tt').tabs('select', title);
                    //$('#tt').tabs('select', title);
                    $('#main').tabs('close', title);
                    $('#main').tabs('add', {
                        title: title,
                        content: "<iframe scrolling=\"no\" frameborder=\"0\" Src=\"" + url + "\" Style=\"width:100%;height:99%;\"></iframe>",
                        iconCls: 'icon-applicationgo',
                        closable: true
                    });
                }
                else {
                    $('#main').tabs('select', title);
                }
            } else {
                $('#main').tabs('add', {
                    title: title,
                    content: "<iframe scrolling=\"no\" frameborder=\"0\" Src=\"" + url + "\" Style=\"width:100%;height:99%;\"></iframe>",
                    iconCls: 'icon-applicationgo',
                    closable: true
                });
            }
        }

        function binddt(tn,year)
        {         
            $('#dt').datagrid({
                title: tn,
                url: 'Admin_ReportDesign_View.aspx?year=' + year+'&tn='+tn,
                iconCls: 'icon-edit',
                height: userScreenHeight - 399, singleSelect: true, striped: true,
                width: '170',
                columns: [[
                             { field: 'NF', title: '节点名称', width: 100, sortable: true, formatter: function (val, rec) { return unescape(val) } }
                ]]                
            });
        }

        function editrow(tn) {
            var node = $('#tt').datagrid('getSelected');
            var xml = $('#ddl_xml').combo('getValue');            
            if (node) {
                add('Admin_ReportDesign_View.aspx?tn='+node.NodeName+"&xml="+xml,node.NodeName+'设计');
            }
        }

        $(function () {
            bindnode();
        });
    </script>
</head>
<body   class="easyui-layout" style="padding:0px;">
    <form id="form1" runat="server">
    <div data-options="region:'north',split:false,collapsed:false" style="height:35px; overflow:hidden; padding:0px">
        <div style="padding:5px;">
                    <asp:DropDownList ID="ddl_xml" ClientIDMode="Static" runat="server" CssClass="easyui-combobox" data-options="onSelect: function(rec){bindnode();}"></asp:DropDownList>
        </div>
    </div>  
    <div data-options="region:'center'" > 
         <div  id="main" class="easyui-tabs" style="width:99%;height:auto;padding:0px;"	data-options="iconCls:'icon-save',collapsible:false,minimizable:false,maximizable:false,closable:false,tools:'#tab-tools'"  fit="true" border="0">
            <!--工作区-->
    </div>
    </div>   
    <div data-options="region:'west',split:true,collapse:false" style="width:188px;padding:5px;">
        <table id="tt"></table>
    </div>  
    </form>
</body>
</html>
